package lk.icta.common.service.impl;

import lk.icta.common.dao.PresidentDAO;
import lk.icta.common.entity.President;
import lk.icta.common.service.PresidentManagementService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: root
 * Date: 10/22/12
 * Time: 11:55 AM
 * To change this template use File | Settings | File Templates.
 */
public class PresidentManagementServiceImpl implements PresidentManagementService {

    private static final Logger logger = LoggerFactory.getLogger(PresidentManagementServiceImpl.class);
    private final PresidentDAO presidentDAO;

    public PresidentManagementServiceImpl(PresidentDAO presidentDAO) {
        this.presidentDAO = presidentDAO;
    }

    @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
    public List<President> getCurrentPresident() {
        return presidentDAO.getCurrentPresident();
    }
}
